﻿// See https://aka.ms/new-console-template for more information


namespace clock      /* 新的程序中创建了新的命名空间“Hello” */
{
    class Program            /* 创建了类（class）“Program” */
    {
        static void Main(String[] args)
        {
            Clock clock = new Clock(1, 10);
            clock.addAlways += ( sender,  e) =>
            {
                Console.WriteLine("Tick");
            };

            clock.addOnce += ( sender,  e) =>
            {
                Console.WriteLine("Just once,Alarm");
            };
            clock.begin();
            while (true)
            {
                Thread.Sleep(1000);
            }
        }
    }
}